import unittest

import ddt

from Base.BaseSetings import TestData_dir
from Business.TeachingManagement_cx import TeachingManagementTest

@ddt.ddt()
class TMtest(unittest.TestCase):
    @classmethod
    # def setUpClass(cls) -> None:
    #     cls.TM = TeachingManagementTest()
        # cls.TM.login()
    def setUp(self) -> None:
        self.TM = TeachingManagementTest()
    # def tearDown(self) -> None:
    #     pass

    # @unittest.skip
    @ddt.file_data(TestData_dir + 'teaching_management.yaml')
    def test_case_add_apply(self,**kwargs):

        id,table2 = self.TM.add_apply(kwargs.get('accounting_way'),kwargs.get('belong_region'),kwargs.get('flag'))
        self.assertEqual(int(id)+1,int(table2[0][0]))



    # @unittest.skip
    def test_case_apply_reason(self):
        res = self.TM.apply_reason()
        self.assertEqual(res,'加班原因少于10字不能提交')

    # @unittest.skip
    # def test_case_assign_work(self):
    #     tableInfo,selectedText = self.TM.assign_work()
    #     self.assertEqual(selectedText,tableInfo[0][1])
    #
    # @unittest.skip
    # def test_case_sys_employee_query(self):
    #     res = self.TM.sys_employee_query()
    #     self.assertEqual(res, eval("[['无符合条件的记录']]"))

    # def testz(self):
    #     self.TM.close_browser()

if __name__ == '__main__':
    unittest.main()